from helpers.director.shortcut import ModelTable,TablePage,ModelFields,director,page_dc
from . models import ProductPart

class ProdectPartPage(TablePage):
    def get_label(self):
        return '产品部件'
    def get_template(self, prefer=None):
        return 'jb_admin/table_new.html'
    
    class tableCls(ModelTable):
        model = ProductPart
        exclude =[]
        pop_edit_fields = ['id']


class ProductPartForm(ModelFields):
    class Meta:
        model = ProductPart
        exclude =[]

director.update({
    'product-part':ProdectPartPage.tableCls,
    'product-part.edit':ProductPartForm,
    
})

page_dc.update({
    'product-part':ProdectPartPage
})